﻿<dialogs:BaseMetroDialog 
  x:Class="SoftTeach.View.Noten.MetroAddHausaufgabenDialog"
  xmlns:dialogs="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:setting="clr-namespace:SoftTeach.Setting"
  xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
  mc:Ignorable="d"
  d:DesignWidth="991.045" d:DesignHeight="479.114"
  DataContext="{Binding Source={x:Static setting:Selection.Instance}, Path=Schülerliste}">
  <dialogs:BaseMetroDialog.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/SoftTeach;component/Resources/MetroResources.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Themes/Dialogs/BaseMetroDialog.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatSlider.xaml" />
        <ResourceDictionary >
          <CollectionViewSource x:Key="SortierteKlassenlisteViewSource" Source="{Binding Path=Schülereinträge}">
            <CollectionViewSource.SortDescriptions>
              <componentModel:SortDescription PropertyName="SchülereintragPerson.PersonVorname" Direction="Ascending" />
            </CollectionViewSource.SortDescriptions>
          </CollectionViewSource>
        </ResourceDictionary>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </dialogs:BaseMetroDialog.Resources>
  <Grid>
    <StackPanel>
      <Grid Margin="10">
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel  Grid.Row="0">
          <StackPanel Orientation="Horizontal">
            <Label Style="{StaticResource MetroLabelStyle}">Hausaufgabe:</Label>
            <Label Style="{StaticResource MetroLabelStyle}" Content="{Binding Source={x:Static setting:Selection.Instance}, Path=HausaufgabeBezeichnung}"/>
            <Label Style="{StaticResource MetroLabelStyle}">vom</Label>
            <Label Style="{StaticResource MetroLabelStyle}" Content="{Binding Source={x:Static setting:Selection.Instance}, Path=HausaufgabeDatumString}"/>
          </StackPanel>
          <Label  Style="{StaticResource MetroLabelStyle}">Wer hat seine Hausaufgaben nicht gemacht?</Label>
        </StackPanel>
        <ListBox Grid.Row="1"
                 ItemsSource="{Binding Source={StaticResource SortierteKlassenlisteViewSource}}"             
                 BorderThickness="0"
                 Name="HausaufgabenListBox"
                 ItemTemplate="{StaticResource MetroKlassenlisteHausaufgabenView}"
                 ItemContainerStyle="{StaticResource UnselectableListBoxItem}"
                 >
          <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
              <WrapPanel Width="{Binding ElementName=HausaufgabenListBox, Path=ActualWidth, Converter={StaticResource WrapPanelWidthConverter}}"/>
            </ItemsPanelTemplate>
          </ListBox.ItemsPanel>
          <!--<ListBox.ItemContainerStyle >
            <Style TargetType="ListBoxItem">
               <Setter Property="Padding" Value="0"/>
            </Style>
          </ListBox.ItemContainerStyle>-->
        </ListBox>
        <!--<DataGrid Grid.Row="1" ItemsSource="{Binding Path=CurrentSchülerliste.Schülereinträge}" AutoGenerateColumns="False" >
          <DataGrid.Columns>
            <DataGridTextColumn Header="Klasse" Binding="{Binding Path=Model.Schülerliste.Klasse.Bezeichnung}" SortMemberPath="Bezeichnung"/>
            <DataGridTextColumn Header="Vorname" Binding="{Binding Path=SchülereintragPerson.PersonVorname}" SortMemberPath="PersonVorname"/>
            <DataGridTextColumn Header="Nachname" Binding="{Binding Path=SchülereintragPerson.PersonNachname}" SortMemberPath="PersonNachname"/>
            <DataGridCheckBoxColumn Header="HA nicht gemacht"/>
          </DataGrid.Columns>
        </DataGrid>-->
      </Grid>
      <Button Width="100" FontSize="20" Margin="10" Content="Fertig" Style="{DynamicResource AccentedSquareButtonStyle}" Click="FertigButtonOnClick"/>
    </StackPanel>
  </Grid>
</dialogs:BaseMetroDialog>
